

/*working directory*/ 
cd "~/dropbox/switching on and off/replication pb/"

/* Packages
ssc install reghdfe
ssc install ftools
ssc install blindschemes, replace all
set scheme plotplain
ssc install estout
*/

***********************************************
***********************************************
***********************************************
***********************************************
*				ANES  STUDY1				***
***********************************************
***********************************************
***********************************************
***********************************************

use "anes_timeseries_cdf.dta", clear


**********************************************
*************RECODING ************************
**********************************************

*** independent variables

*year
gen year = VCF0004 

*pid
recode VCF0301  (1/3=1) (5/7=0) (else=.), gen(dem)
gen i = 1-dem
replace i = dem if year==1952 
replace i = dem if year==1962
replace i = dem if year==1964
replace i = dem if year==1966
replace i = dem if year==1968
replace i = dem if year==1978
replace i = dem if year==1980
replace i = dem if year==1994
replace i = dem if year==1996
replace i = dem if year==1998
replace i = dem if year==2000
replace i = dem if year==2012
replace i = dem if year==2016

gen gallup = year				
recode gallup (	2016	=	0.51	)
recode gallup (	2012	=	0.5	)
recode gallup (	2008	=	0.33	)
recode gallup (	2004	=	0.52	)
recode gallup (	2002	=	0.66	)
recode gallup (	2000	=	0.6	)
recode gallup (	1998	=	0.63	)
recode gallup (	1996	=	0.6	)
recode gallup (	1994	=	0.39	)
recode gallup (	1992	=	0.39	)
recode gallup (	1990	=	0.76	)
recode gallup (	1988	=	0.54	)
recode gallup (	1986	=	0.61	)
recode gallup (	1984	=	0.57	)
recode gallup (	1982	=	0.42	)
recode gallup (	1980	=	0.37	)
recode gallup (	1978	=	0.42	)
recode gallup (	1976	=	0.45	)
recode gallup (	1974	=	0.24	)
recode gallup (	1972	=	0.49	)
recode gallup (	1970	=	0.57	)
recode gallup (	1968	=	0.42	)
recode gallup (	1966	=	0.46	)
recode gallup (	1964	=	0.7	)
recode gallup (	1962	=	0.63	)
recode gallup (	1960	=	0.58	)
recode gallup (	1958	=	0.57	)
recode gallup (	1956	=	0.68	)
recode gallup (	1954	=	0.66	)
recode gallup (	1952	=	0.33	)
recode gallup (1/max=.)				

gen g1 = (gallup- .33)/(0.76- .33)

*** dependent variables

gen turnoutm = VCF0702
recode turnoutm (0/1=0) (2=1)
replace turnout = turnoutm if year==1958
replace turnout = turnoutm if year==1962
replace turnout = turnoutm if year==1966
replace turnout = turnoutm if year==1970
replace turnout = turnoutm if year==1974

recode VCF0310  (0=.) (1=0) (2=.5) (3=1) (9=.), gen (interest1)
recode VCF0311 (0=.) (1=0) (2=1), gen (care1)
recode VCF0312 (0=.) (1=0) (2=1), gen (care2)
recode VCF0313  (0=.) (1=0) (2=.33) (3=.67) (4=1) (9=.), gen (interest2)
recode VCF0724  (0=.) (1=0) (2=1), gen (tv)
recode VCF0725  (0=.) (1=0) (2=1), gen (radio)
recode VCF0726  (0=.) (1=0) (2=1), gen (magazine)
recode VCF0727  (0=.) (1=0) (2=1), gen (np)
recode VCF9035  (8/9=.), gen(tv7)
recode VCF9033 (8/9=.), gen(np7)
gen media = tv +radio + magazine +np

***Controls

recode VCF0301 (3=0) (2=.5) (4=.) (5=0) (6=.5) (7=1), gen(pidstrength)
gen age7 = VCF0102 
recode VCF0110 (1/3=0) (4=1) (0=2), gen(college)
recode VCF0104 (1=0) (2=1) (0=2) (3=2), gen(female)
recode VCF0106 (3=0) (0=4) (9=4), gen (race3)


**********************************************
************* MAIN RESULTS *******************
**********************************************


***Figure 1

mean interest1, over(year), if i==0
matrix out=e(b)'

mean interest1, over(year), if i==1
matrix in=e(b)'
matrix diff = in-out

mean gallup, over(year), if interest1~=.
matrix gallup=e(b)'

svmat double diff, name(y)
svmat double gallup, name(x)


pwcorr y1 x1, sig

/*
             |       y1       x1
-------------+------------------
          y1 |   1.0000 
             |
             |
          x1 |   0.3756   1.0000 
             |   0.0489

*/

twoway (scatter y1 x1, m(circle) leg(off)  text(.033 .75 "r = 0.38  p < 0.05", size(3)) xsize(4) ysize(4) xtitle("Presidential Approval (Gallup)") ytitle("In-party minus Out-party"))(lfit y1 x1)
graph export "fig1.pdf", replace


***Table 1

/*
comparing clustered SEs vs naive SE
	* note: we report the model with larger estimate of the SE for the
	* interaction between inpartisanship and gallup
	
cls
eststo clear
eststo: quietly reghdfe interest1 i##c.g1 , noabsorb vce(cluster year)
eststo: quietly reg interest1 i##c.g1
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], noabsorb vce(cluster year)
eststo: quietly reg interest1 i##c.g1 [weight=VCF0009z]
eststo: quietly reghdfe interest1 i##c.g1 , absorb (year) vce(cluster year )
eststo: quietly reg interest1 i##c.g1 i.year
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year )
eststo: quietly reg interest1 i##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe interest1 i##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 , absorb (year) vce(cluster year)
eststo: quietly reg interest1 i##c.g1 i##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year 
eststo: quietly reghdfe interest1 i##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg interest1 i##c.g1 i##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
esttab using tab1-se-check.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)
*/

cls
eststo clear
eststo: quietly reghdfe interest1 i##c.g1 , noabsorb vce(cluster year)
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], noabsorb vce(cluster year)
eststo: quietly reghdfe interest1 i##c.g1 , absorb (year) vce(cluster year )
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year )
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 , absorb (year) vce(cluster year)
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
esttab using tab1.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)
esttab using tab1.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)



*** College vs non-college graduates

reg interest1 coll [weight=VCF0009z]

/*
------------------------------------------------------------------------------
   interest1 |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     college |   .1497549   .0037497    39.94   0.000     .1424053    .1571044
       _cons |   .5106879   .0017587   290.38   0.000     .5072408    .5141349
------------------------------------------------------------------------------

106/150 = 71%

*/


**********************************************
************* APPENDIX A RESULTS *************
**********************************************


*** TABLE A1 
su interest1 interest2 care1 care2 tv np radio media


**********************************************
************* APPENDIX B RESULTS *************
**********************************************


*** TABLE B1: Full Regression Estimates of Table 1 


eststo clear
eststo: quietly reghdfe interest1 i##c.g1 , noabsorb vce(cluster year)
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], noabsorb vce(cluster year)
eststo: quietly reghdfe interest1 i##c.g1 , absorb (year) vce(cluster year )
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year )
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 , absorb (year) vce(cluster year)
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
esttab using tab1.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)
esttab using tab1.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)


*** TABLE B2: Other interest DV

/*comparing clustered SEs vs naive SE
	* note: we report the model with larger estimate of the SE for the
	* interaction between inpartisanship and gallup
eststo clear
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg interest1 i##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year[weight=VCF0009z]
eststo: quietly reghdfe interest2 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg interest2 i##c.g1 i.year[weight=VCF0009z]
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe care1 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg care1 i##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe care2 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg care2 i##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
esttab using interest-se-check.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 
*/

eststo clear
eststo: quietly reghdfe interest1 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe interest2 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) /*SE larger when cluster dropped*/
eststo: quietly reghdfe care1 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe care2 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
esttab using tab-b2-interest.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 
esttab using tab-b2-interest.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 



*** Table B3: Media exposure as DV

/*comparing clustered SEs vs naive SE
	* note: we report the model with larger estimate of the SE for the
	* interaction between inpartisanship and gallup
eststo clear
eststo: quietly reghdfe tv i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg tv i##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year[weight=VCF0009z]
eststo: quietly reghdfe np i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg np i##c.g1 i.year[weight=VCF0009z]
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe radio i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg radio i##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe magazine i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg magazine i##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe magazine i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg magazine i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
eststo: quietly reghdfe media i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reg media i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 i.year [weight=VCF0009z]
esttab using media-se-check.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 
*/

eststo clear
eststo: quietly reghdfe tv i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe np i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe radio i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe magazine i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe magazine i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe media i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo: quietly reghdfe media i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year)  /*SE larger when cluster dropped*/
esttab using tab-b3-media.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 
esttab using tab-b3-media.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 



***Table B4: Correlation Matrix 
eststo clear
estpost corr interest1 interest1 interest2 care1 care2 tv np radio magazine 
eststo cor1
estpost corr interest2 interest1 interest2 care1 care2 tv np radio magazine 
eststo cor2
estpost corr care1 interest1 interest2 care1 care2 tv np radio magazine 
eststo cor3
estpost corr care2 interest1 interest2 care1 care2 tv np radio magazine 
eststo cor4
estpost corr tv interest1 interest2 care1 care2 tv np radio magazine 
eststo cor5
estpost corr np interest1 interest2 care1 care2 tv np radio magazine 
eststo cor6
estpost corr radio interest1 interest2 care1 care2 tv np radio magazine 
eststo cor7
estpost corr magazine interest1 interest2 care1 care2 tv np radio magazine 
eststo cor8
esttab using tab-b4-cor.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 

*** Table B5: Continuous exposure as DV
cls
eststo clear
eststo:  reghdfe tv7 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo:  reghdfe tv7 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) /*year cluster dropped*/
eststo:  reghdfe np7 i##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year)
eststo:  reghdfe np7 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) /*year cluster dropped*/
esttab using tab-b5-media2.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 
esttab using tab-b5-media2.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 

*** After FOX

recode year (min/1996=0) (1998/max=1), gen(fox)


/*comparing clustered SEs vs naive SE
	* note: we report the model with larger estimate of the SE for the
	* interaction between inpartisanship and gallup
eststo clear
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==1
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==0
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==1
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==1
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==1
esttab using fox-se-check.csv, replace se nogap b(5)  star (+ 0.1 * 0.05 ** 0.01) 
eststo clear
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==1
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==0
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==1
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==1
esttab using fox-se-check2.csv, replace se nogap b(5)  star (+ 0.1 * 0.05 ** 0.01) 
*/


*** Table B6: Difference in Political Interest by Presidential Performance and In- and Out-Partisanship Before and After Fox 
eststo clear
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe interest1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==1
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe interest2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe care1 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==1
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe care2 i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==1
esttab using tab-b6-fox-interest.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 
esttab using tab-b6-fox-interest.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 

***Table B7: Difference in News Exposure by Presidential Performance and In- and Out-Partisanship Before and After Fox 
eststo clear
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==0
eststo: quietly reghdfe tv i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year), if fox==1
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe np i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==1
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) vce(cluster year), if fox==0
eststo: quietly reghdfe radio i##c.g1 dem##c.g1 i.age7##c.g1 i.female##c.g1 i.race3##c.g1 i.college##c.g1 [weight=VCF0009z], absorb (year) , if fox==1
esttab using tab-b7-fox-media.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 
esttab using tab-b7-fox-media.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01) 

***Table B8:  Relationship between Presidential Performance and Political Attentiveness among Pure Independent


eststo clear
eststo: quietly reghdfe interest1 g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe interest2 g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe care1 g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe care2 g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe tv g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe np g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe radio g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe magazine g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
eststo: quietly reghdfe media g1 [weight=VCF0009z], noabsorb vce(cluster year), if VCF0301==4
esttab using tab-b8.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)
esttab using tab-b8.tex, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)


***********************************************
***********************************************
***********************************************
***********************************************
*				NAES STUDY 2				***
***********************************************
***********************************************
***********************************************
***********************************************


use "naes2008.dta", clear

**********************************************
*************RECODING ************************
**********************************************

*** independent variables

* date/treatment
rename *, lower
tostring date_c, gen(date_st)
gen date  = date(date_st, "YMD")
format date %tdnn/dd/YY

	/*
	17790 is cutoff (09/15/2008) 
	twoway lpolyci DV date,xlabel(17790, format(%tdnn/dd/YY))
	*/

gen tc = date-17790

	* tc is running variable centered at cutoff

recode tc (-28/-22=-4) (-21/-15=-3) (-14/-8=-2) (-7/-1=-1) (0/6=0) (7/13=1) (14/20=2) (21/27=3) (28/34=4) (else=.), gen(tcweekly)
recode tcweekly (-1=0) (0=1) (1=2) (2=3) (3=4) (4=5) (else=.), gen(treat)


* pid
gen pid7=.
replace pid7=0 if ma01_c ==1 & ma02_c ==1
replace pid7=1 if ma01_c ==1 & ma02_c ~=1
replace pid7=2 if ma01_c >2 & ma03_c ==1
replace pid7=3 if ma01_c >2 & ma03_c >2
replace pid7=4 if ma01_c >2 & ma03_c ==2
replace pid7=5 if ma01_c ==2 & ma02_c ~=1
replace pid7=6 if ma01_c ==2 & ma02_c ==1

recode pid7 (0/2=0) (3=.) (4/6=1), gen(dem)
gen rep = 1-dem

*** dependent variables

*** media counts

* TV
	gen tv_abc = 0 
	replace tv_abc = 1 if eb03_c==1 
	replace tv_abc = 1 if eb06raa_c==1 
	gen tv_abcworldnews = 0 
	replace tv_abcworldnews  = 1 if  eb03_c==2
	replace tv_abcworldnews  = 1 if  eb06rab_c==1
	gen tv_andersoncooper = 0 
	replace tv_andersoncooper= 1 if  eb03_c==3
	replace tv_andersoncooper= 1 if  eb06rac_c==1
	gen tv_cbs = 0
	replace tv_cbs = 1 if eb03_c==4
	replace tv_cbs = 1 if eb06rad_c==1
	gen tv_cbseveningnews = 0 
	replace tv_cbseveningnews = 1 if eb03_c==5
	replace tv_cbseveningnews = 1 if  eb06rae_c==1
	gen tv_cbn = 0 
	replace tv_cbn = 1 if eb03_c==6
	replace tv_cbn = 1 if eb06raf_c==1
	gen tv_cnn = 0
	replace tv_cnn = 1 if eb03_c==7
	replace tv_cnn = 1 if eb06rag_c==1 
	gen tv_countdown = 0
	replace  tv_countdown = 1 if eb03_c==8
	replace  tv_countdown = 1 if eb06rah_c==1 
	gen tv_foxnews = 0 
	replace tv_foxnews = 1 if  eb03_c==9
	replace tv_foxnews = 1 if  eb06raj_c==1
	gen tv_foxreport = 0 
	replace tv_foxreport = 1 if  eb03_c==10
	replace tv_foxreport = 1 if  eb06rak_c==1
	gen tv_glennbeck = 0 
	replace tv_glennbeck = 1 if eb03_c==11
	replace tv_glennbeck = 1 if eb06ral_c==1
	gen tv_hannity = 0 
	replace tv_hannity = 1 if eb03_c==12
	replace tv_hannity = 1 if eb06ram_c==1
	gen tv_hardball = 0 
	replace tv_hardball = 1 if eb03_c==13
	replace tv_hardball = 1 if eb06ran_c==1
	gen tv_headline = 0 
	replace tv_headline = 1 if eb03_c==14
	replace tv_headline = 1 if eb06rap_c==1
	gen tv_larryking = 0 
	replace tv_larryking = 1 if eb03_c==15
	replace tv_larryking = 1 if eb06raq_c==1
	gen tv_localnews = 0
	replace tv_localnews = 1 if eb03_c==16
	replace tv_localnews = 1 if eb06rar_c==1
	gen tv_loudobbs = 0 
	replace tv_loudobbs = 1 if eb03_c==17
	replace tv_loudobbs = 1 if eb06ras_c==1
	gen tv_meetthepress = 0
	replace tv_meetthepress = 1 if  eb03_c==18
	replace tv_meetthepress = 1 if  eb06rat_c==1
	gen tv_msnbc=0
	replace tv_msnbc = 1 if  eb03_c==19
	replace tv_msnbc = 1 if  eb06rau_c==1
	gen tv_nancygrace = 0 /* nancy grace = neutral? */
	replace tv_nancygrace = 1 if  eb03_c==20
	replace tv_nancygrace = 1 if eb06rav_c==1
	gen tv_nbc = 0
	replace tv_nbc = 1 if  eb03_c==21
	replace tv_nbc = 1 if  eb06raw_c==1
	gen tv_nbcnightlynews = 0
	replace tv_nbcnightlynews = 1 if  eb03_c==22
	replace tv_nbcnightlynews = 1 if  eb06ray_c==1
	gen tv_newshour = 0 
	replace tv_newshour = 1 if  eb03_c==23
	replace tv_newshour = 1 if  eb06rba_c==1
	gen tv_nightline = 0
	replace tv_nightline = 1 if  eb03_c==24
	replace tv_nightline = 1 if  eb06rbb_c==1
	gen tv_oreilly = 0
	replace tv_oreilly = 1 if eb03_c==25
	replace tv_oreilly = 1 if  eb06rbc_c==1
	gen tv_pbs = 0 
	replace tv_pbs = 1 if eb03_c==27
	replace tv_pbs = 1 if eb06rbe_c==1
	gen tv_700club = 0 /* 700 club = neutral */
	replace tv_pbs = 1 if eb03_c==28
	replace tv_700club = 1 if  eb06rbf_c==1
	gen tv_situationroom = 0 
	replace tv_situationroom = 1 if eb03_c==29
	replace tv_situationroom = 1 if eb06rbg_c==1 
	gen tv_hume = 0 
	replace tv_hume = 1 if eb03_c==30
	replace tv_hume = 1 if eb06rbh_c==1 
	gen tv_today = 0 
	replace tv_today = 1 if eb03_c==31
	replace tv_today = 1 if eb06rbj_c==1 
	gen tv_yourworld = 0 
	replace tv_yourworld = 1 if eb03_c==33
	replace tv_yourworld = 1 if eb06rbl_c==1 
	gen tv_other = 0 
	replace tv_other = 1 if  eb03_c==34
	gen tv_other2 = 0 
	replace tv_other2 = 1 if  eb06rzz_c==1 
	gen tv_ontherecord = 0 /* on the record = republican slant */
	replace tv_ontherecord = 1 if  eb06rbd_c==1 
	gen tv_tucker = 0 /*** no one watched this program / liberal slant */
	replace tv_tucker = 1 if  eb06rbk_c==1
egen tv = rowtotal(tv_abc-tv_tucker) 
	** calculating the total count of TV programs watched and percentage of partisan media 
	*total 34 programs mentioned 

					

*RADIO
	gen r_allthings = 0 
	replace r_allthings = 1 if ec02_c==1 
	replace r_allthings = 1 if ec04raa_c==1 
	gen r_glennbeck = 0 
	replace r_glennbeck = 1 if ec02_c==2 
	replace r_glennbeck = 1 if ec04rab_c==1 
	gen r_billbennett = 0 
	replace r_billbennett= 1 if ec02_c==3 
	replace r_billbennett = 1 if ec04rac_c==1 
	gen r_jimbohannon = 0 
	replace r_jimbohannon = 1 if ec02_c==4 
	replace r_jimbohannon = 1 if ec04rad_c==1 
	gen r_nealboortz = 0 
	replace r_nealboortz = 1 if ec02_c==5 
	replace r_nealboortz = 1 if ec04rae_c==1 
	gen r_christianradio  = 0 
	replace r_christianradio = 1 if ec02_c==6 
	replace r_christianradio = 1 if ec04raf_c==1 
	gen r_jerrydoyle = 0 
	replace r_jerrydoyle = 1 if ec02_c==7 
	replace r_jerrydoyle = 1 if ec04rag_c==1
	gen r_focus = 0 
	replace r_focus = 1 if ec02_c==8 
	replace r_focus = 1 if ec04rah_c==1
	gen r_mikegallagher = 0 
	replace r_mikegallagher = 1 if ec02_c==9
	replace r_mikegallagher = 1 if ec04raj_c==1 
	gen r_seanhannity = 0 
	replace r_seanhannity = 1 if ec02_c==10 
	replace r_seanhannity = 1 if ec04rak_c==1 
	gen r_howard = 0 
	replace r_howard = 1 if ec02_c==11
	replace r_howard = 1 if ec04ral_c==1 
	gen r_lauraingraham = 0 
	replace r_lauraingraham = 1 if ec02_c==12 
	replace r_lauraingraham = 1 if ec04ram_c==1
	gen r_tomjoyner = 0 
	replace r_tomjoyner = 1 if ec02_c==13 
	replace r_tomjoyner = 1 if ec04ran_c==1 
	gen r_marklevin = 0 
	replace r_marklevin = 1 if ec02_c==14 
	replace r_marklevin = 1 if ec04rap_c==1
	gen r_rushlimbaugh = .0 
	replace r_rushlimbaugh = 1 if ec02_c==15 
	replace r_rushlimbaugh = 1 if ec04raq_c==1
	gen r_localnews = 0 
	replace r_localnews = 1 if ec02_c==16 
	replace r_localnews = 1 if ec04rar_c==1 
	gen r_localtalk = 0 
	replace r_localtalk = 1 if ec02_c==17 
	replace r_localtalk = 1 if ec04ras_c==1 
	gen r_morningedition = 0 
	replace r_morningedition = 1 if ec02_c==18 
	replace r_morningedition = 1 if ec04rat_c==1 
	gen r_npr = 0 
	replace r_npr = 1 if ec02_c==19 
	replace r_npr = 1 if ec04rau_c==1 
	gen r_billoreilly = 0 
	replace r_billoreilly = 1 if ec02_c==20 
	replace r_billoreilly = 1 if ec04rav_c==1 
	gen r_michaelsavage = 0 
	replace r_michaelsavage = 1 if ec02_c==21 
	replace r_michaelsavage = 1 if ec04raw_c==1 
	gen r_schlessinger = 0 
	replace r_schlessinger = 1 if ec02_c==22 
	gen r_other = 0 
	replace r_other = 1 if ec02_c==23 
	gen r_other2 = 0 
	replace r_other2 = 1 if ec04rzz_c==1 
egen radio = rowtotal(r_allthings-r_other2) 
	** calculating the total count of radio programs people listened to and percentage of partisan media 
	*total 19 programs mentioned (20 if including none)


* newspaper
	gen n_arizona = . 
	replace n_arizona = 1 if ed02_c==1 
	replace n_arizona = 1 if  ed04raa_c==1
	gen n_atlanta = . 
	replace n_arizona = 1 if ed02_c==2 
	replace n_arizona = 1 if ed04rab_c==1
	gen n_baltimoresun = . 
	replace n_baltimoresun = 1 if ed02_c==3
	replace n_baltimoresun = 1 if ed04rac_c==1
	gen n_bostonglobe = . 
	replace n_bostonglobe = 1 if ed02_c==4 
	replace n_bostonglobe = 1 if ed04rad_c==1
	gen n_chicagosun= . 
	replace n_chicagosun = 1 if ed02_c==5 
	replace n_chicagosun = 1 if ed04rae_c==1
	gen n_chicagotribune = . 
	replace n_chicagotribune = 1 if ed02_c==6 
	replace n_chicagotribune = 1 if ed04raf_c==1
	gen n_cleveland = . 
	replace n_cleveland = 1 if ed02_c==7 
	replace n_cleveland = 1 if ed04rag_c==1
	gen n_concord = . 
	replace n_concord = 1 if ed02_c==8 
	replace n_concord = 1 if ed04rah_c==1
	gen n_dallas = . 
	replace n_dallas = 1 if ed02_c==9 
	replace n_dallas = 1 if ed04raj_c==1
	gen n_denver = . 
	replace n_denver = 1 if ed02_c==10 
	replace n_denver = 1 if ed04rak_c==1
	gen n_desmoines = . 
	replace n_desmoines = 1 if ed02_c==11 
	replace n_desmoines = 1 if ed04ral_c==1
	gen n_detroit = . 
	replace n_detroit = 1 if ed02_c==12 
	replace n_detroit = 1 if ed04ram_c==1
	gen n_houston = . 
	replace n_houston = 1 if ed02_c==13 
	replace n_houston = 1 if ed04ran_c==1
	gen n_latimes = . 
	replace n_latimes = 1 if ed02_c==14 
	replace n_latimes = 1 if ed04rap_c==1
	gen n_miamiherald = . 
	replace n_miamiherald = 1 if ed02_c==15 
	replace n_miamiherald = 1 if ed04raq_c==1
	gen n_newhampshire = . 
	replace n_newhampshire = 1 if ed02_c==16 
	replace n_newhampshire = 1 if ed04rar_c==1
	gen n_nydaily = . 
	replace n_nydaily = 1 if ed02_c==17 
	replace n_nydaily = 1 if ed04ras_c==1
	gen n_nypost = . 
	replace n_nypost = 1 if ed02_c==18 
	replace n_nypost = 1 if ed04rat_c==1
	gen n_nytimes = . 
	replace n_nytimes = 1 if ed02_c==19 
	replace n_nytimes = 1 if ed04rau_c==1
	gen n_newsday = . 
	replace n_newsday = 1 if ed02_c==20
	replace n_newsday = 1 if ed04rav_c==1
	gen n_orangecounty = . 
	replace n_orangecounty = 1 if ed02_c==21
	replace n_orangecounty = 1 if ed04raw_c==1
	gen n_oregonian = . 
	replace n_oregonian = 1 if ed02_c==22
	replace n_oregonian = 1 if ed04ray_c==1
	gen n_philly = . 
	replace n_philly = 1 if ed02_c==23 
	replace n_philly = 1 if ed04rba_c==1
	gen n_rocky = . 
	replace n_rocky  = 1 if ed02_c==24 
	replace n_rocky  = 1 if ed04rbb_c==1
	gen n_sandiego = . 
	replace n_sandiego = 1 if ed02_c==25  
	replace n_sandiego = 1 if ed04rbc_c==1   
	gen n_sfchronicle = . 
	replace n_sfchronicle = 1 if ed02_c==26 
	replace n_sfchronicle = 1 if ed04rbd_c==1   
	gen n_sanjose = . 
	replace n_sanjose = 1 if ed02_c==27 
	replace n_sanjose = 1 if ed04rbe_c==1   
	gen n_stlouis = . 
	replace n_stlouis = 1 if ed02_c==28 
	replace n_stlouis = 1 if ed04rbf_c==1   
	gen n_stpetersburg = . 
	replace n_stpetersburg = 1 if ed02_c==29 
	replace n_stpetersburg = 1 if ed04rbg_c==1   
	gen n_startribune = . 
	replace n_startribune = 1 if ed02_c==30 
	replace n_startribune = 1 if ed04rbh_c==1   
	gen n_starledger = . 
	replace n_starledger = 1 if ed02_c==31 
	replace n_starledger = 1 if ed04rbj_c==1   
	gen n_usatoday = . 
	replace n_usatoday = 1 if ed02_c==32 
	replace n_usatoday = 1 if ed04rbk_c==1   
	gen n_wsj = . 
	replace n_wsj = 1 if ed02_c==33 
	replace n_wsj = 1 if ed04rbl_c==1   
	gen n_wp = . 
	replace n_wp = 1 if ed02_c==34 
	replace n_wp = 1 if ed04rbm_c==1   
	gen n_other = . 
	replace n_other = 1 if ed02_c==35 
	gen n_other2 = . 
	replace n_other2 = 1 if ed04rzz_c==1   
egen np = rowtotal(n_arizona-n_other2)

* online sites 
	gen int_abcnews = 0 
	replace int_abcnews = 1 if ee03_c==1 
	replace int_abcnews = 1 if ee05raa_c==1 
	gen int_aol = 0 
	replace int_aol = 1 if ee03_c==2 
	replace int_aol = 1 if ee05rab_c==1 
	gen int_cbsnews = 0 
	replace int_cbsnews = 1 if ee03_c==3
	replace int_cbsnews = 1 if ee05rac_c==1 
	gen int_cnn = 0 
	replace int_cnn = 1 if ee03_c==4
	replace int_cnn = 1 if ee05rad_c==1 
	gen int_comcast = 0 
	replace int_comcast = 1 if ee03_c==5
	replace int_comcast = 1 if ee05rae_c==1 
	gen int_dailykos = 0 
	replace int_dailykos  = 1 if ee03_c==6
	replace int_dailykos  = 1 if ee05raf_c==1 
	gen int_demparty = 0 
	replace int_demparty = 1 if ee03_c==7
	replace int_demparty = 1 if ee05rag_c==1 
	gen int_drudgereport = 0 
	replace int_drudgereport = 1 if ee03_c==8
	replace int_drudgereport = 1 if ee05rah_c==1 
	gen int_emails = 0 
	replace int_emails = 1 if ee03_c==9
	replace int_emails = 1 if ee05raj_c==1 
	gen int_foxnews = 0 
	replace int_foxnews  = 1 if ee03_c==10
	replace int_foxnews  = 1 if ee05rak_c==1 
	gen int_google = 0 
	replace int_google = 1 if ee03_c==11
	replace int_google = 1 if ee05ral_c==1 
	gen int_homepage = 0 
	replace int_homepage = 1 if ee03_c==12
	replace int_homepage = 1 if ee05ram_c==1 
	gen int_huffpost = 0 
	replace int_huffpost = 1 if ee03_c==13
	replace int_huffpost = 1 if ee05ran_c==1 
	gen int_instapundit = 0 
	replace int_instapundit = 1 if ee03_c==14
	replace int_instapundit = 1 if ee05rap_c==1 
	gen int_michellemalkin = 0 
	replace int_michellemalkin = 1 if ee03_c==15
	replace int_michellemalkin = 1 if ee05raq_c==1 
	gen int_msn = 0 
	replace int_msn = 1 if ee03_c==16
	replace int_msn = 1 if ee05rar_c==1 
	gen int_msnbc = 0 
	replace int_msnbc  = 1 if ee03_c==17
	replace int_msnbc  = 1 if ee05ras_c==1 
	gen int_nationaljournal = 0 
	replace int_nationaljournal = 1 if ee03_c==18
	replace int_nationaljournal = 1 if ee05rat_c==1 
	gen int_nbcnews = 0 
	replace int_nbcnews = 1 if ee03_c==19
	replace int_nbcnews = 1 if ee05rau_c==1 
	gen int_newrepublic = 0 
	replace int_newrepublic = 1 if ee03_c==20
	replace int_newrepublic = 1 if ee05rav_c==1 
	gen int_nytimes = 0 
	replace int_nytimes = 1 if ee03_c==21
	replace int_nytimes = 1 if ee05raw_c==1 
	gen int_powerline = 0 
	replace int_powerline = 1 if ee03_c==22
	replace int_powerline = 1 if ee05ray_c==1 
	gen int_repparty = 0 
	replace int_repparty = 1 if ee03_c==23
	replace int_repparty = 1 if ee05rba_c==1 
	gen int_slate = 0 
	replace int_slate = 1 if ee03_c==24
	replace int_slate = 1 if ee05rbb_c==1 
	gen int_talkingpoints = 0 
	replace int_talkingpoints = 1 if ee03_c==25
	replace int_talkingpoints = 1 if ee05rbc_c==1 
	gen int_thinkprogress = 0 
	replace int_thinkprogress = 1 if ee03_c==26
	replace int_thinkprogress = 1 if ee05rbd_c==1 
	gen int_townhall = 0 
	replace int_townhall = 1 if ee03_c==27
	replace int_townhall = 1 if ee05rbe_c==1 
	gen int_wsj = 0 
	replace int_wsj = 1 if ee03_c==28
	replace int_wsj = 1 if ee05rbf_c==1 
	gen int_wp = 0 
	replace int_wp = 1 if ee03_c==29
	replace int_wp = 1 if ee05rbg_c==1 
	gen int_yahoo = 0 
	replace int_yahoo = 1 if ee03_c==30
	replace int_yahoo = 1 if ee05rbh_c==1
	gen int_youtube = 0 
	replace int_youtube = 1 if ee03_c==31
	replace int_youtube = 1 if ee05rbj_c==1
	gen int_other = 0 
	replace int_other = 1 if ee03_c==32
	gen int_other2 = 0 
	replace int_other2 = 1 if ee05rzz_c==1 
egen internet = rowtotal(int_abcnews-int_other2)


replace internet=. if wg01_c~=1


* overall counts
 gen media1         = tv+radio+internet+np
 gen off1 = tv+radio+np
 

* partisan media counts
egen tv_liberal = rowtotal(tv_andersoncooper tv_cnn tv_countdown tv_hardball tv_headline tv_msnbc tv_nightline tv_situationroom tv_tucker) 
egen tv_conserv = rowtotal(tv_foxnews tv_foxreport tv_glennbeck tv_hannity tv_oreilly tv_ontherecord tv_hume tv_yourworld)
egen tv_neutral = rowtotal(tv_abc tv_abcworldnews tv_cbs tv_cbseveningnews tv_cbn  tv_countdown    tv_larryking tv_localnews tv_loudobbs tv_meetthepress  tv_nancygrace tv_nbc tv_nbcnightlynews tv_newshour   tv_pbs tv_700club  tv_today  tv_other tv_other2)
egen np_liberal = rowtotal(n_wp n_nytimes) 
egen np_conserv = rowtotal(n_wsj)
egen np_neutral = rowtotal(n_arizona n_atlanta n_baltimoresun n_bostonglobe n_chicagosun n_chicagotribune n_cleveland n_concord n_dallas n_denver n_desmoines n_detroit n_houston n_latimes n_miamiherald n_newhampshire n_nydaily n_nypost  n_newsday n_orangecounty n_oregonian n_philly n_rocky n_sandiego n_sfchronicle n_sanjose n_stlouis n_stpetersburg n_startribune n_starledger n_usatoday   n_other n_other2)
egen radiocount_conserv = rowtotal(r_glennbeck r_billbennett  r_nealboortz  r_christianradio   r_jerrydoyle  r_mikegallagher r_seanhannity r_lauraingraham  r_marklevin  r_rushlimbaugh r_billoreilly r_michaelsavage)
egen radiocount_neutral = rowtotal(r_allthings r_jimbohannon r_tomjoyner r_localnews r_localtalk r_morningedition r_npr)
egen radio_neutral = rowtotal (r_allthings  r_jimbohannon r_focus r_howard  r_tomjoyner  r_localnews r_localtalk r_morningedition r_npr r_schlessinger r_other r_other2)
egen radio_conservative = rowtotal (r_glennbeck     r_billbennett      r_nealboortz          r_christianradio r_jerrydoyle  r_mikegallagher r_seanhannity      r_lauraingraham       r_marklevin             r_rushlimbaugh        r_billoreilly r_michaelsavage)
egen internet_liberal = rowtotal( int_cnn  int_dailykos int_demparty int_huffpost int_msnbc  int_nytimes  int_slate  int_talkingpoints int_thinkprogress  int_wp  int_newrepublic) 
egen internet_conserv = rowtotal( int_drudgereport  int_foxnews int_michellemalkin  int_powerline  int_repparty  int_townhall  int_wsj  int_instapundit)
egen internet_neutral = rowtotal(int_abcnews int_aol int_cbsnews  int_comcast   int_emails  int_google int_homepage   int_msn  int_nationaljournal int_nbcnews   int_yahoo int_youtube int_other int_other2)
replace internet_liberal=. if wg01_c~=1
replace internet_conserv=. if wg01_c~=1
replace internet_neutral=. if wg01_c~=1
 gen liberal = tv_lib+np_lib+internet_lib
 **Note: there was no liberal radio program 
 gen conservative = tv_con+radio_con+np_con+internet_con
 gen neutral = tv_neu+radio_neu+np_neu+internet_neu /*end of source counting*/

*** media days 
recode eb02_c     (998/999=0), gen (tvd)
recode ec01_c     (998/999=0), gen (radiod)
recode ed01_c     (998/999=0), gen (npd)
recode ee02_c     (998/999=0), gen (internetd)
alpha tvd radiod npd internetd, a c gen(media2)
alpha tvd radiod npd , a c gen(off2)

*** online engagement
recode kg09_c (2=0) (998/999=.), gen(video)
recode kg02_c (2=0) (998/999=.), gen(website)
recode kg13_c (2=0) (998/999=.), gen(forward)
recode kg19_c (2=0) (998/999=.), gen(chat)
recode kg23_c (2=0) (998/999=.), gen(blog)
replace video=. if wg01_c~=1
replace website=. if wg01_c~=1
replace forward=. if wg01_c~=1
replace chat=. if wg01_c~=1
replace blog=. if wg01_c~=1
gen online = video+web+for+chat+blog

*** political interest
recode ka01_c  (1=1) (2=.67) (3=.33) (4=0) (998/999=0), gen (interest)

*** Covariates
recode pid7 (0=1) (1=.5) (2=0) (3=.) (4=0) (5=.5) (6=1),gen(pidstrength)
recode ae02_c (2=.67) (3=.33) (4=0) (998/999=.), gen(bushapproval) 
recode rd01_c  (1/4=1) (5=0) (998/999=0), gen(turnout04)
recode rd01_c  (1/4=1) (5=0) (998/999=.), gen(turnout04_n) /*missing dummy*/
recode cba02_c  (1=0) (2=.25) (3=.5) (4=.75) (5=1)  (998/999=.), gen(econ)
recode ca02 (2=0) (998/999=.), gen(rightdirection) /*country going right direction?*/
recode rd02_c  (4=1) (else=0), gen(turnout06)
recode rd02_c  (1/3=0) (4=1) (5=0) (998/999=.), gen(turnout06_n) /*missing dummy*/
recode rbb02_c  (1/2=1) (3/999=0) (.=2), gen(turnoutpr)
recode rbb02_c  (1/2=1) (3/999=0) (.=.), gen(turnoutpr_n) /*missing dummy*/
recode wa02_c (18/35=0) (36/50=1) (51/65=2) (65/97=3) (998/999=4), gen(age4)
recode wa02_c(98/max=.), gen(age)
recode wa01_c (1=0) (2=1), gen(female)
recode wc03_c (3/max=0), gen(race3)
recode wc03_c (1=1) (2/7=0) (998/999=.), gen(white)
recode wc03_c (1=0) (2=1) (3/7=0) (998/999=.), gen(black)
recode wa03_c (1/5=0) (6/10=1) (998/999=2), gen(college)
recode wa03_c (1/5=0) (6/10=1) (998/999=.), gen(college_n) /*missing dummy*/
recode wfc02_c (1/2=1) (3=0), gen(urban)
recode wfa03_c (1=1) (998/999=2) (else=0), gen (married)
recode wfa03_c (1=1) (998/999=.) (else=0), gen (married_n) /*missing dummy*/
recode wb01_c (1/2=1) (3/8=0) (998/999=2), gen(employed)
recode wb01_c (1/2=1) (3/8=0) (998/999=.), gen(employed_n) /*missing dummy*/
recode wg01_c  (1=1) (2=0) (else=.), gen(access) /*internet access*/



**********************************************
************* MAIN RESULTS *******************
**********************************************

*** Figure 2

bysort tc: egen media1_day_rep=mean(media1) if dem==0
bysort tc: egen media1_day_dem=mean(media1) if dem==1
gen media1_day=media1_day_rep
replace media1_day = media1_day_dem if dem==1

twoway (lpolyci media1  tc, bw(3) color(red*0.2)  xlabel(-7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid) ylabel(3 (.2) 4.4) ///
	leg(off) ytitle("Number of News Sources") title("Panel A: News Sources among Republicans") text(4.3 -3.5 "Pre-Treatment", color(red) size(3)) xsize(3.25) ysize(3.25), if tcw<=-1 )  ///
	(lpolyci media1  tc, bw(3) color(%50), if tcw>=0 )  ///
	(scatter media1_day tc, m(circle) color(red), if treat==0) ///	
	(scatter media1_day tc, m(circle) color(black) xline(0), if treat>=1)  if dem==0 & treat<=3
graph export "fig-2a.pdf", replace

twoway (lpolyci media1  tc, bw(3) color(red*0.2)  xlabel(-7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid)  ylabel(3 (.2) 4.4) ///
	leg(off) ytitle("Number of News Sources") title("Panel B: News Sources among Democrats")  xsize(3.25) ysize(3.25), if tcw<=-1 )  ///
	(lpolyci media1  tc, bw(3) color(%50), if tcw>=0 )  ///
	(scatter media1_day tc, m(circle) color(red), if treat==0) ///	
	(scatter media1_day tc, m(circle) color(black)  xline(0), if treat>=1)  if dem==1 & treat<=3
graph export "fig-2b.pdf", replace

bysort tc: egen media2_day_rep=mean(media2) if dem==0
bysort tc: egen media2_day_dem=mean(media2) if dem==1

gen media2_day=media2_day_rep
replace media2_day = media2_day_dem if dem==1

twoway (lpolyci media2  tc, bw(3) color(red*0.2)  xlabel(-7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid) ylabel(3 (.2) 4) ///
	leg(off) ytitle("Number of Days") title("Panel C: Exposure Frequency among Republicans") xsize(3.25) ysize(3.25), if tcw<=-1 )  ///
	(lpolyci media2  tc, bw(3) color(%50), if tcw>=0 )  ///
	(scatter media2_day tc, m(circle) color(red), if treat==0) ///	
	(scatter media2_day tc, m(circle) color(black) xline(0), if treat>=1)  if dem==0 & treat<=3
graph export "fig-2c.pdf", replace

twoway (lpolyci media2  tc, bw(3) color(red*0.2)  xlabel(-7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid)  ylabel(3 (.2) 4) ///
	leg(off) ytitle("Number of Days") title("Panel D: Exposure Frequency among Democrats")  xsize(3.25) ysize(3.25), if tcw<=-1 )  ///
	(lpolyci media2  tc, bw(3) color(%50), if tcw>=0 )  ///
	(scatter media2_day tc, m(circle) color(red), if treat==0) ///	
	(scatter media2_day tc, m(circle) color(black)  xline(0), if treat>=1)  if dem==1 & treat<=3
graph export "fig-2d.pdf", replace

	


*** Table 2


cls
eststo clear
eststo: quietly reg media1 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media1 i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media2 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media2 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg interest i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg interest i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg online i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem)/4
eststo: quietly reg online i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem)/4
esttab using tab-2.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01 )


*** Table 3

cls
eststo clear
eststo: quietly reg internet i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internet i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internetd i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internetd i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off1 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off1 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off2 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off2 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
esttab using tab-3.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)

*** table 4 was generated in R; use the file "replication 2 NAES_panel.R" in the replication pacakge to reproduce it.




**********************************************
************* APPENDIX C RESULTS *************
**********************************************

su media1 media2 interest online internet internetd off1 off2


**********************************************
************* APPENDIX D RESULTS *************
**********************************************

*** Table D1
eststo clear
eststo: reg rep i.treat, ro
eststo: reg turnoutpr_n  i.treat, ro
eststo: reg turnout04_n i.treat, ro
eststo: reg turnout06_n i.treat, ro
eststo: reg age i.treat, ro
eststo: reg female i.treat, ro
eststo: reg college_n i.treat, ro
eststo: reg white i.treat, ro
eststo: reg black i.treat, ro
eststo: reg employed_n i.treat, ro
eststo: reg married_n i.treat, ro
eststo: reg urban i.treat, ro
esttab using tab-d1.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01 )

***Table D2
eststo clear
eststo: reg turnoutpr_n  i.treat##dem, ro
eststo: reg turnout04_n i.treat##dem, ro
eststo: reg turnout06_n i.treat##dem, ro
eststo: reg age i.treat##dem, ro
eststo: reg female i.treat##dem, ro
eststo: reg college_n i.treat##dem, ro
eststo: reg white i.treat##dem, ro
eststo: reg black i.treat##dem, ro
eststo: reg employed_n i.treat##dem, ro
eststo: reg married_n i.treat##dem, ro
eststo: reg urban i.treat##dem, ro
esttab using tab-d2.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01 )

*Table D3
recode tc (-31/-1=1) (else=0), gen(priormonth)
gen priorday=tc+31
replace priorday=. if priormonth==0
eststo clear
eststo: reg media1 c.priorday##dem, ro
eststo: reg media2 c.priorday##dem, ro
eststo: reg interest c.priorday##dem, ro
eststo: reg online c.priorday##dem, ro
esttab using tab-d3.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01 )


*** Figure D1
bysort tc: egen rightdirection_day=mean(rightdirection) 
twoway (lpolyci rightdirection  tc, bw(3) color(red*0.2)  xlabel(-7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid) text(.3 -3.5 "Pre-Treatment", color(red) size(3))  ///
	leg(off) ytitle("1 = In Right Direction") title("Panel A: The Direction of the Country")xsize(3.25) ysize(3.25) , if tcw<=-1 )  ///
	(lpolyci rightdirection  tc, bw(3) color(%50)  xlabel(-7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid) ylabel(0 (.1) .3) ///
	, if tcw>=0 ) ///
	(scatter rightdirection_day tc, m(circle) color(red), if tcw<=-1) ///	
	(scatter rightdirection_day tc, m(circle) color(black) xline(0), if tcw>=0)  if treat<=3
graph export "fig-d1a.pdf", replace
	
	
bysort tc: egen bushapproval_day=mean(bushapproval) 
twoway (lpolyci bushapproval  tc, bw(3)  color(red*0.2)  xlabel(-7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid)  ///
	leg(off) ytitle("1 = Strongly Approve") title("Panel B: Approval of Bush")xsize(3.25) ysize(3.25), if tcw<=-1 )  ///
	(lpolyci bushapproval  tc, bw(3) color(%50)  xlabel( -7 "9/8" 0 `" "9/15" "Lehman Bankrupcy" "' 7 "9/22" 14 "9/29" 21 "10/6", nogrid)  ///
	, if tcw>=0 ) ///
	(scatter bushapproval_day tc, m(circle) color(red), if tcw<=-1) ///	
	(scatter bushapproval_day tc, m(circle) color(black) xline(0), if tcw>=0)  if treat<=3
graph export "fig-d1b.pdf", replace


**********************************************
************* APPENDIX E RESULTS *************
**********************************************

*Table E3 
preserve

replace treat=. if tc<-3

cls
eststo clear
eststo: quietly reg media1 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media1 i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media2 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media2 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg interest i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg interest i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg online i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem)/4
eststo: quietly reg online i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem)/4
esttab using tab-e3.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01 )

*Table E4

cls
eststo clear
eststo: quietly reg internet i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internet i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internetd i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internetd i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off1 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off1 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off2 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off2 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
esttab using tab-e5.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)

restore
preserve
replace treat=. if tc<-1


*Table E5
cls
eststo clear
eststo: quietly reg media1 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media1 i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media2 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg media2 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg interest i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg interest i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg online i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem)/4
eststo: quietly reg online i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem)/4
esttab using tab-e4.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01 )


*Table E6
cls
eststo clear
eststo: quietly reg internet i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internet i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internetd i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg internetd i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off1 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off1 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
test  1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem=0
eststo: quietly reg off2 i.treat##dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
eststo: quietly reg off2 i.treat##dem i.treat##dem c.turnoutpr##c.dem c.turnout06##c.dem c.turnout04##c.dem  i.age4##c.dem fem##c.dem i.race##c.dem i.college##c.dem i.employed##c.dem    i.married##c.dem  i.urban##c.dem, ro
lincom (1.treat#1.dem+ 2.treat#1.dem+ 3.treat#1.dem+ 4.treat#1.dem+ 5.treat#1.dem)/5
esttab using tab-e6.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)

restore

*Table E7
preserve
keep if pid7==3
cls
eststo clear
eststo: quietly reg media1 i.treat, ro
eststo: quietly reg media1 i.treat c.turnoutpr c.turnout06 c.turnout04  i.age4 fem i.race i.college i.employed    i.married  i.urban, ro
eststo: quietly reg media2 i.treat, ro
eststo: quietly reg media2 i.treat i.treat c.turnoutpr c.turnout06 c.turnout04  i.age4 fem i.race i.college i.employed    i.married  i.urban, ro
eststo: quietly reg interest i.treat, ro
eststo: quietly reg interest i.treat i.treat c.turnoutpr c.turnout06 c.turnout04  i.age4 fem i.race i.college i.employed    i.married  i.urban, ro
eststo: quietly reg online i.treat, ro
eststo: quietly reg online i.treat i.treat c.turnoutpr c.turnout06 c.turnout04  i.age4 fem i.race i.college i.employed    i.married  i.urban, ro
esttab using tab-e7.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01 )
restore



***tables e8-e9 were generated in R; use the file "replication 2 NAES_panel.R" in the replication pacakge to reproduce them.

**********************************************
************* APPENDIX F RESULTS *************
**********************************************

eststo clear
eststo: reg liberal i.treat, ro, if dem==0
eststo: reg neut i.treat, ro, if dem==0
eststo: reg conserv i.treat, ro, if dem==0
eststo: reg internet_liberal i.treat, ro, if dem==0
eststo: reg internet_neut i.treat, ro, if dem==0
eststo: reg internet_conserv i.treat, ro, if dem==0
eststo: reg tv_liberal i.treat, ro, if dem==0
eststo: reg tv_neut i.treat, ro, if dem==0
eststo: reg tv_conserv i.treat, ro, if dem==0
eststo: reg np_liberal i.treat, ro, if dem==0
eststo: reg np_neut i.treat, ro, if dem==0
eststo: reg np_conserv i.treat, ro, if dem==0
eststo: reg np_neut i.treat, ro, if dem==0
eststo: reg radio_conserv i.treat, ro, if dem==0
esttab using tab-f1.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)


cls
eststo clear
eststo: reg liberal i.treat, ro, if dem==1
eststo: reg neut i.treat, ro, if dem==1
eststo: reg conserv i.treat, ro, if dem==1
eststo: reg internet_liberal i.treat, ro, if dem==1
eststo: reg internet_neut i.treat, ro, if dem==1
eststo: reg internet_conserv i.treat, ro, if dem==1
eststo: reg tv_liberal i.treat, ro, if dem==1
eststo: reg tv_neut i.treat, ro, if dem==1
eststo: reg tv_conserv i.treat, ro, if dem==1
eststo: reg np_liberal i.treat, ro, if dem==1
eststo: reg np_neut i.treat, ro, if dem==1
eststo: reg np_conserv i.treat, ro, if dem==1
eststo: reg radio_neut i.treat, ro, if dem==1
eststo: reg radio_conserv i.treat, ro, if dem==1
esttab using tab-f2.csv, replace se nogap b(3)  star (+ 0.1 * 0.05 ** 0.01)











